home *** CD-ROM | disk | FTP | other *** search
- /*
- sc_event.c - events common to scope windows and packet
- */
- #include "sc.h"
- #include "sc_event.h"
-
- void e_grow(where)
- Point where;
- {(*gl.cur_windef->w_grow)(where);
- }
-
- void e_activate(a_win)
- WindowPtr a_win;
- {if(((WindowPeek)a_win)->windowKind!=gl.win_ref_num)
- bomb(BOMB_badwind,BMB_no_os,(long)gl.cur_windef->wd_type);
- gl.cur_windef=(windef *)(a_win);
- SetPort(CUR_WINDOW);
- (*gl.cur_windef->w_activate)();
- }
-
- void e_deactivate(a_win)
- WindowPtr a_win;
- {(*gl.cur_windef->w_deactavate)();
- SetPort(NIL);
- gl.cur_windef=NIL;
- }
-
- /*handle mouse down in the content region*/
- void e_down_content(the_event)
- EventRecord *the_event;
- {(*gl.cur_windef->w_mouse_down)(the_event);
- }
-
- /*process an update event*/
- void e_update_event(the_event)
- EventRecord *the_event;
- {windef *save_windef; /*pointer to our per window information*/
- WindowPtr save_window;
- GetPort(&save_window);
- save_windef=gl.cur_windef; /*change the windef with the port*/
- gl.cur_windef= (windef *)(the_event->message);
- SetPort(CUR_WINDOW); /*switch to the port to update*/
-
- BeginUpdate(CUR_WINDOW);
- EraseRect(&CUR_WINDOW->portRect); /*yes, clear the update area*/
- UpdtControl(CUR_WINDOW,CUR_WINDOW->visRgn);/*draw its controls*/
- (*gl.cur_windef->w_draw)();
- EndUpdate(CUR_WINDOW);
- SetPort(save_window);
- gl.cur_windef=save_windef;
- }
-
-